<!-- <style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style> -->
<template src="./index.html"></template>
<script>
    export default {
        mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
        components: {
            SelectImageRadio: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectImageRadio()),
            SelectDataUsers: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectDataUsers()),
        },
        data() {
            return {
                appWindow: window,
                form: {
                    member_id: "",
                    mobile: "",
                    status: 1,
                    name: "",  
                },
                // 页面接口地址
                apiUrl: {
                    create: "plugin/cashier-desk/admin/clerk/add",
                    update: "plugin/cashier-desk/admin/clerk/edit",
                    detail: "plugin/cashier-desk/admin/clerk/detail",
                },
                usersIds: [],
            };
        },
        methods: {


            // 初始化
            async init() {
               
                // 初始化数据
                await this.mixinEdit_editBoxInit({
                    model: "form",
                    id: this.id,
                })
            },
            // 修改关系链弹窗  获取想更改的用户的id
            changeRelation() {
                this.$vFN.Directives.SelectDataUsers ({
                    appWindow: this.appWindow,
                    selectIds: this.usersIds,
                    apiConfig: this.$vFN.Tools.getAppGlobalData('componentsApiConfig.SelectDataUsers', this.appWindow),
                    count: 1,
                    onSuccess: (res) => {
                        // 返回客户数组  因为只选一个 所以res[0]
                        console.log(res, "res");
                        this.form.member_id = res[0]
                    },
                });
            },

        },
        mounted() {
            this.init();
        },
        activated() {},
    };
</script>